package com.example.mylitepal.model;

import org.litepal.annotation.Column;
import org.litepal.crud.LitePalSupport;

public class Song extends LitePalSupport {
    //name是唯一的，且默认值为unknown
    @Column(unique = true, defaultValue = "unknown")
    private String name;
    //nullable不为空
    @Column(nullable=false)
    private int duration;
    private String size;
    //ignore忽略即是不在数据库中创建该属性对应的字段
    @Column(ignore = true)
    private float price;

    //添加所有字段的getter和setter方法
    public String getName() {
        return name;
    }
    public int getDuration() {
        return duration;
    }
    public String getSize() { return size; }
    public float getPrice() { return price; }
    public void setName(String name) {
        this.name = name;
    }
    public void setDuration(int duration) {
        this.duration = duration;
    }
    public void setSize(String size) { this.size = size; }
    public void setPrice(float price) { this.price = price; }
}
